package lex.profile.ui.outline;

import javax.swing.tree.TreeModel;

import org.lex.swing.Swings;
import org.lex.utils.Pair;
import org.netbeans.swing.outline.DefaultOutlineModel;
import org.netbeans.swing.outline.Outline;
import org.netbeans.swing.outline.OutlineModel;

import com.vladium.utils.ObjectProfiler;

public class ProfileOutlineTest {
	public static void main(String[] args) {
		Swings.setUseBoldMetalFont(false);
		Object obj = create();
		TreeModel treeModel = new ProfileTreeModel(ObjectProfiler.profile(obj));
		OutlineModel model = DefaultOutlineModel.createOutlineModel(treeModel, new ProfileRowModel(), false, "Object");
		final Outline outline = new Outline(model);
		outline.setRenderDataProvider(new ObjectProfileNodeRenderer());
		// outline.setAutoResizeMode( Outline.AUTO_RESIZE_OFF );
		outline.setPopupUsedFromTheCorner(true);
		outline.setFillsViewportHeight(true);
		// TableHelper.test( outline );
		Swings.show(outline);
	}

	static Object create() {
		return Pair.wrap(new int[6], System.getenv());
	}
}
